home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / info-service / www / src / fminit2.0 / init.lsp < prev    next >
Encoding:
Lisp/Scheme  |  1992-11-17  |  1.3 KB  |  48 lines

  1. ;; init.lsp -- init XLisp global environment
  2. ;;
  3.  
  4. (defun require (package)
  5.   (unless (get package 'provided)
  6.       (or (load (concatenate 'string (string-downcase package) ".ol"))
  7.           (load (concatenate 'string (string-downcase package) ".l"))
  8.           (load (concatenate 'string (string-downcase package) ".lsp"))
  9.           (error "can't load package" package))
  10.       ) )
  11.  
  12. (defun provide (package)
  13.   (setf (get package 'provided) t)
  14.   )
  15.  
  16.  
  17. ; from 2.1almy...
  18. ; initialization file for XLISP 2.0
  19.  
  20. (unless (fboundp 'strcat) ; backwards compatibility if COMMONLISP defined
  21.     (defmacro strcat (&rest str) `(concatenate 'string ,@str)))
  22.  
  23.  
  24. ; define some macros
  25. (defmacro defvar (sym &optional val)
  26.   `(if (boundp ',sym) ,sym (setq ,sym ,val)))
  27. (defmacro defparameter (sym val)
  28.   `(setq ,sym ,val))
  29. (defmacro defconstant (sym val)
  30.   `(setq ,sym ,val))
  31.  
  32. ; (makunbound sym) - make a symbol value be unbound
  33. (defun makunbound (sym) (setf (symbol-value sym) '*unbound*) sym)
  34.  
  35. ; (fmakunbound sym) - make a symbol function be unbound
  36. (defun fmakunbound (sym) (setf (symbol-function sym) '*unbound*) sym)
  37.  
  38. ; (mapcan fun list [ list ]...)
  39. (defmacro mapcan (&rest args) `(apply #'nconc (mapcar ,@args)))
  40.  
  41. ; (mapcon fun list [ list ]...)
  42. (defmacro mapcon (&rest args) `(apply #'nconc (maplist ,@args)))
  43.  
  44. ; initialize to enable breaks and trace back
  45. (setq *breakenable* t)
  46. (setq *tracenable* nil)
  47. (alloc 50000)
  48.